﻿<UserControl x:Class="ViCode_LeVi.Controls.VMTabAnalysis_Tab2" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:vmcontrol="clr-namespace:ViCode_LeVi.Controls"
    xmlns:Langs="clr-namespace:ViCode_LeVi.Langs"
             xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
    xmlns:visualizationToolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit">
    <UserControl.Resources>
        <vmcontrol:VMTabAnalysis_Tab1_Item_Color_Converter x:Key="VMTabAnalysis_Tab1_Item_Color_Converter"/>
    </UserControl.Resources>
    <DockPanel LastChildFill="True">
        <GroupBox  Margin="2">
            <GroupBox.Header>
                <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="Evaluation_Chart_Option_Text"/>
            </GroupBox.Header>
            <GroupBox.Content>
                <StackPanel Name="StackPanel_Config">
                    <GroupBox Header="CAPTION" Margin="2">
                        <StackPanel>
                            <CheckBox IsChecked="{Binding Display_Y_ID}" Content="ID" Margin="2"/>
                            <CheckBox IsChecked="{Binding Display_Y_Name}" Content="Name" Margin="2"/>
                        </StackPanel>
                    </GroupBox>
                    <GroupBox Margin="2">
                        <GroupBox.Header>
                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="Evaluation_Chart_Legend_Text"/>
                        </GroupBox.Header>
                        <GroupBox.Content>
                            <StackPanel Name="StackPanel_TaskType">

                            </StackPanel>
                        </GroupBox.Content>
                    </GroupBox>
                </StackPanel>

            </GroupBox.Content>
        </GroupBox>
        <DockPanel>
            <Grid DockPanel.Dock="Bottom">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="Analysis_Interpretation_Text" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2"/>
                <vmcontrol:VMTextBox_MultiLine Grid.Row="1" MinLines="3" Text="{Binding Interpretation2}" Margin="2" HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
            </Grid>
            <GroupBox  Margin="2">
                <GroupBox.Header>
                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="Evaluation_Chart_DisplayChart_Text"/>
                </GroupBox.Header>
                <GroupBox.Content>
                    <Grid>
                        <chartingToolkit:Chart  Name="barChart" Title=""   HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"
                                VerticalAlignment="Stretch" VerticalContentAlignment="Stretch"
		 Margin="2" >
                            <!--ItemsSource="{Binding}"-->
                            <chartingToolkit:BarSeries DependentValuePath="X_Quantity" IndependentValuePath="Y"
                                               Title="{Binding Source={x:Static Langs:ControlTextInfo.Intance}, Path=TaskItem_Quantity_Text}"
                                               IsSelectionEnabled="False">
                                <chartingToolkit:DataPointSeries.ItemsSource>
                                    <Binding BindsDirectlyToSource="True"/>
                                </chartingToolkit:DataPointSeries.ItemsSource>
                            </chartingToolkit:BarSeries>
                            <chartingToolkit:BarSeries DependentValuePath="X_Quanlity" IndependentValuePath="Y" 
                                               Title="{Binding Source={x:Static Langs:ControlTextInfo.Intance}, Path=TaskItem_Quanlity_Text}"
                                               IsSelectionEnabled="False">
                                <chartingToolkit:DataPointSeries.ItemsSource>
                                    <Binding BindsDirectlyToSource="True"/>
                                </chartingToolkit:DataPointSeries.ItemsSource>
                            </chartingToolkit:BarSeries>
                            <chartingToolkit:BarSeries DependentValuePath="X_System" IndependentValuePath="Y" 
                                               Title="{Binding Source={x:Static Langs:ControlTextInfo.Intance}, Path=TaskItem_Systematic_Text}"
                                               IsSelectionEnabled="False">
                                <chartingToolkit:DataPointSeries.ItemsSource>
                                    <Binding BindsDirectlyToSource="True"/>
                                </chartingToolkit:DataPointSeries.ItemsSource>
                            </chartingToolkit:BarSeries>

                            <chartingToolkit:Chart.Axes>
                                <chartingToolkit:LinearAxis Orientation="X"
                       ShowGridLines="True"
                       Title="" 
                        Minimum="0" Maximum="100" Interval="10" />

                                <!--<chartingToolkit:LinearAxis Orientation="Y"
                       ShowGridLines="True"
                       Title="Dependent Title" />-->
                                <!--<chartingToolkit:DateTimeAxis Orientation="X"
                         ShowGridLines="True"
                         Interval="1"
                         IntervalType="Days" />-->
                            </chartingToolkit:Chart.Axes>


                            <chartingToolkit:Chart.Palette>
                                <visualizationToolkit:ResourceDictionaryCollection>
                                    <!-- Blue-->
                                    <ResourceDictionary>
                                        <RadialGradientBrush x:Key="Background" GradientOrigin="-0.1,-0.1"
Center="0.075,0.015" RadiusX="1.05" RadiusY="0.9">
                                            <GradientStop Color="Green"/>
                                            <GradientStop Color="White" Offset="1"/>
                                        </RadialGradientBrush>
                                        <Style x:Key="DataPointStyle" TargetType="chartingToolkit:BarDataPoint">
                                            <Setter Property="Background" Value="{StaticResource Background}"/>
                                        </Style>
                                    </ResourceDictionary>
                                    <ResourceDictionary>
                                        <RadialGradientBrush x:Key="Background" GradientOrigin="-0.1,-0.1"
Center="0.075,0.015" RadiusX="1.05" RadiusY="0.9">
                                            <GradientStop Color="Blue"/>
                                            <GradientStop Color="White" Offset="1"/>
                                        </RadialGradientBrush>
                                        <Style x:Key="DataPointStyle" TargetType="chartingToolkit:BarDataPoint">
                                            <Setter Property="Background" Value="{StaticResource Background}"/>
                                        </Style>
                                    </ResourceDictionary>
                                    <ResourceDictionary>
                                        <RadialGradientBrush x:Key="Background" GradientOrigin="-0.1,-0.1"
Center="0.075,0.015" RadiusX="1.05" RadiusY="0.9">
                                            <GradientStop Color="Red"/>
                                            <GradientStop Color="White" Offset="1"/>
                                        </RadialGradientBrush>
                                        <Style x:Key="DataPointStyle" TargetType="chartingToolkit:BarDataPoint">
                                            <Setter Property="Background" Value="{StaticResource Background}"/>
                                        </Style>
                                    </ResourceDictionary>
                                    <ResourceDictionary>
                                        <RadialGradientBrush x:Key="Background" GradientOrigin="-0.1,-0.1"
Center="0.075,0.015" RadiusX="1.05" RadiusY="0.9">
                                            <GradientStop Color="Green"/>
                                            <GradientStop Color="Blue" Offset="1"/>
                                        </RadialGradientBrush>
                                        <!--BasedOn="{StaticResource LineDataPointStyle1}"-->
                                        <!--<Style x:Key="DataPointStyle" TargetType="chartingToolkit:BarDataPoint" >
                            <Setter Property="Background" Value="{StaticResource Background}" />
                            <Setter Property="Height" Value="100" />
                            <Setter Property="Width" Value="100" />
                        </Style>-->
                                        <!--<Style x:Key="DataPointStyle" TargetType="chartingToolkit:BarDataPoint">
                                    <Setter Property="Background" Value="{Binding Path=., Converter={StaticResource VMTabAnalysis_Tab1_Item_Color_Converter}}"/>
                                    <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource Self}, Converter={StaticResource converter}}"/>
                                </Style>-->

                                    </ResourceDictionary>
                                </visualizationToolkit:ResourceDictionaryCollection>
                            </chartingToolkit:Chart.Palette>
                        </chartingToolkit:Chart>
                    </Grid>
                </GroupBox.Content>
            </GroupBox>
        </DockPanel>
    </DockPanel>
</UserControl>
